Optimal. Leaf size=88 \[ \frac {a^3 x}{c^2}+\frac {a^3 \tanh ^{-1}(\sin (e+f x))}{c^2 f}-\frac {8 a^3 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))^2}+\frac {4 a^3 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.27, antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps
used = 13, number of rules used = 9, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.346, Rules used = {3988, 3862,
4004, 3879, 3881, 3882, 3884, 4083, 3855} \begin {gather*} \frac {a^3 \tanh ^{-1}(\sin (e+f x))}{c^2 f}+\frac {4 a^3 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))}-\frac {8 a^3 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))^2}+\frac {a^3 x}{c^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3855
Rule 3862
Rule 3879
Rule 3881
Rule 3882
Rule 3884
Rule 3988
Rule 4004
Rule 4083
Rubi steps
\begin {align*} \int \frac {(a+a \sec (e+f x))^3}{(c-c \sec (e+f x))^2} \, dx &=\frac {\int \left (\frac {a^3}{(1-\sec (e+f x))^2}+\frac {3 a^3 \sec (e+f x)}{(1-\sec (e+f x))^2}+\frac {3 a^3 \sec ^2(e+f x)}{(1-\sec (e+f x))^2}+\frac {a^3 \sec ^3(e+f x)}{(1-\sec (e+f x))^2}\right ) \, dx}{c^2}\\ &=\frac {a^3 \int \frac {1}{(1-\sec (e+f x))^2} \, dx}{c^2}+\frac {a^3 \int \frac {\sec ^3(e+f x)}{(1-\sec (e+f x))^2} \, dx}{c^2}+\frac {\left (3 a^3\right ) \int \frac {\sec (e+f x)}{(1-\sec (e+f x))^2} \, dx}{c^2}+\frac {\left (3 a^3\right ) \int \frac {\sec ^2(e+f x)}{(1-\sec (e+f x))^2} \, dx}{c^2}\\ &=-\frac {8 a^3 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))^2}-\frac {a^3 \int \frac {-3-\sec (e+f x)}{1-\sec (e+f x)} \, dx}{3 c^2}+\frac {a^3 \int \frac {(-2-3 \sec (e+f x)) \sec (e+f x)}{1-\sec (e+f x)} \, dx}{3 c^2}+\frac {a^3 \int \frac {\sec (e+f x)}{1-\sec (e+f x)} \, dx}{c^2}-\frac {\left (2 a^3\right ) \int \frac {\sec (e+f x)}{1-\sec (e+f x)} \, dx}{c^2}\\ &=\frac {a^3 x}{c^2}-\frac {8 a^3 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))^2}+\frac {a^3 \tan (e+f x)}{c^2 f (1-\sec (e+f x))}+\frac {a^3 \int \sec (e+f x) \, dx}{c^2}+\frac {\left (4 a^3\right ) \int \frac {\sec (e+f x)}{1-\sec (e+f x)} \, dx}{3 c^2}-\frac {\left (5 a^3\right ) \int \frac {\sec (e+f x)}{1-\sec (e+f x)} \, dx}{3 c^2}\\ &=\frac {a^3 x}{c^2}+\frac {a^3 \tanh ^{-1}(\sin (e+f x))}{c^2 f}-\frac {8 a^3 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))^2}+\frac {4 a^3 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(177\) vs. \(2(88)=176\).
time = 1.28, size = 177, normalized size = 2.01 \begin {gather*} \frac {a^3 (1+\cos (e+f x))^3 \sec ^2\left (\frac {1}{2} (e+f x)\right ) \tan \left (\frac {1}{2} (e+f x)\right ) \left (4 \csc \left (\frac {e}{2}\right ) \sec \left (\frac {1}{2} (e+f x)\right ) \sin \left (\frac {f x}{2}\right )-4 \cot \left (\frac {e}{2}\right ) \sec ^2\left (\frac {1}{2} (e+f x)\right ) \tan \left (\frac {1}{2} (e+f x)\right )+3 \left (f x-\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )+\log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )\right ) \tan ^3\left (\frac {1}{2} (e+f x)\right )\right )}{6 c^2 f (-1+\cos (e+f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.14, size = 66, normalized size = 0.75
method | result | size |
derivativedivides | \(\frac {4 a^{3} \left (-\frac {1}{3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}-\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4}+\frac {\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2}+\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4}\right )}{f \,c^{2}}\) | \(66\) |
default | \(\frac {4 a^{3} \left (-\frac {1}{3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}-\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4}+\frac {\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2}+\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4}\right )}{f \,c^{2}}\) | \(66\) |
risch | \(\frac {a^{3} x}{c^{2}}+\frac {8 i a^{3} \left (3 \,{\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{3 f \,c^{2} \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )^{3}}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{c^{2} f}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{c^{2} f}\) | \(95\) |
norman | \(\frac {\frac {a^{3} x \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c}+\frac {a^{3} x \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c}-\frac {4 a^{3}}{3 c f}+\frac {8 a^{3} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 c f}-\frac {4 a^{3} \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 c f}-\frac {2 a^{3} x \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c}}{\left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{2} c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}+\frac {a^{3} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{c^{2} f}-\frac {a^{3} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{c^{2} f}\) | \(191\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 296 vs.
\(2 (85) = 170\).
time = 0.51, size = 296, normalized size = 3.36 \begin {gather*} \frac {a^{3} {\left (\frac {12 \, \arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{c^{2}} + \frac {{\left (\frac {9 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - 1\right )} {\left (\cos \left (f x + e\right ) + 1\right )}^{3}}{c^{2} \sin \left (f x + e\right )^{3}}\right )} + a^{3} {\left (\frac {6 \, \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{c^{2}} - \frac {6 \, \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{c^{2}} - \frac {{\left (\frac {9 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 1\right )} {\left (\cos \left (f x + e\right ) + 1\right )}^{3}}{c^{2} \sin \left (f x + e\right )^{3}}\right )} - \frac {3 \, a^{3} {\left (\frac {3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 1\right )} {\left (\cos \left (f x + e\right ) + 1\right )}^{3}}{c^{2} \sin \left (f x + e\right )^{3}} + \frac {3 \, a^{3} {\left (\frac {3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - 1\right )} {\left (\cos \left (f x + e\right ) + 1\right )}^{3}}{c^{2} \sin \left (f x + e\right )^{3}}}{6 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.88, size = 168, normalized size = 1.91 \begin {gather*} \frac {8 \, a^{3} \cos \left (f x + e\right )^{2} + 16 \, a^{3} \cos \left (f x + e\right ) + 8 \, a^{3} + 3 \, {\left (a^{3} \cos \left (f x + e\right ) - a^{3}\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) \sin \left (f x + e\right ) - 3 \, {\left (a^{3} \cos \left (f x + e\right ) - a^{3}\right )} \log \left (-\sin \left (f x + e\right ) + 1\right ) \sin \left (f x + e\right ) + 6 \, {\left (a^{3} f x \cos \left (f x + e\right ) - a^{3} f x\right )} \sin \left (f x + e\right )}{6 \, {\left (c^{2} f \cos \left (f x + e\right ) - c^{2} f\right )} \sin \left (f x + e\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {a^{3} \left (\int \frac {3 \sec {\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} - 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \frac {3 \sec ^{2}{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} - 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \frac {\sec ^{3}{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} - 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \frac {1}{\sec ^{2}{\left (e + f x \right )} - 2 \sec {\left (e + f x \right )} + 1}\, dx\right )}{c^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.51, size = 80, normalized size = 0.91 \begin {gather*} \frac {\frac {3 \, {\left (f x + e\right )} a^{3}}{c^{2}} + \frac {3 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{c^{2}} - \frac {3 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{c^{2}} - \frac {4 \, a^{3}}{c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3}}}{3 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.44, size = 45, normalized size = 0.51 \begin {gather*} \frac {a^3\,x}{c^2}+\frac {a^3\,\left (2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )-\frac {4\,{\mathrm {cot}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3}{3}\right )}{c^2\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________